import {defineStore} from 'pinia';
import {Http, Helper, Msg, Cache, Log} from 'core';
const store = {
    id: "share",
    state(){
        return {
            title: "重孝当先",
            desc: "",
            path: "/pages/start?t=s",
            imageUrl: "http://pic-test.shzxdx.com.cn/6197f5f55d2c4e73afdf3f9f9fa49c00.png"//
        }
    },

    getters: {

    },

    actions: {
        async getShare() {
            let {code, data} = await Http.get("/share/config");
            if(code == 200) {
                this.title = data.title;
                this.desc = data.desc;
                this.path = data.path;
                this.imageUrl = data.imageUrl;
            }
        },

        async check(src) {
            return await Http.get("/share/check", {src: src}).validate(false);
        },


        getShareProject(projectId) {

        }
    },
}

export default defineStore(store)
